﻿using Admin.CommonLib.Models.Permission;
using Swimj.CommonLib.Base;

namespace Admin.RazorLib.Services
{
    public interface IPermissionService
    {
        Task<Result<PermissionInfoResponseDto>> CreatePermission(PermissionEditRequestDto requestDto);

        Task<Result<IList<PermissionTreeResponseDto>>> QueryPermissionsByTree(int treeType);

        Task<PaginatedResult<PermissionInfoResponseDto>> QueryPermissions(PermissionSearchRequestDto searchRequestDto);

        Task<Result<PermissionInfoResponseDto>> UpdatePermission(Guid key, PermissionEditRequestDto editRequestDto);

        Task<Result<PermissionInfoResponseDto>> GetPermission(Guid key);

        Task<Result<IList<PermissionTreeResponseDto>>> QueryPermissionsByCurrentUser(int treeType);
        
        Task<HttpResponseMessage> ExportPermissions();
        
        Task<HttpResponseMessage> ExportTemplate();
        
        Task<Result<IList<PermissionInfoResponseDto>>> ImportPermissions(int importType, string uploadFileName, Stream openReadStream);
    }
}